package com.cn.system.common.action;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.system.common.service.CommonService;

/**
 * 系统数据获取公共类
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/com")
public class CommonAction {
	
	@Resource
	private CommonService commonService;
	
	@RequestMapping("/queryMenu")
	@ResponseBody
	public List index() {
		List menu = commonService.queryMenu();
		return menu;
	}
	
	@RequestMapping("/init")
	@ResponseBody
	public Map init(HttpServletRequest request, Model model) {
		HttpSession session = request.getSession(true);
        Map user = (Map) session.getAttribute("user");
        Map init = commonService.init(user);
		return init;
	}
	
}
